package cn.wp.ewallet.wallet.web.controller;

import cn.wp.common.core.Wp;
import cn.wp.common.core.dto.WpResult;
import cn.wp.common.core.web.annotation.ClearInterceptor;
import cn.wp.common.core.web.interceptor.LoginInterceptor;
import cn.wp.ewallet.wallet.model.dto.WalletInfoDto;
import cn.wp.ewallet.wallet.service.WalletInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 钱包-控制层
 * Created by zhangyongli on 2020/01/08
 */
@RestController
@RequestMapping(Wp.WebContext + "/ewallet/wallet/wallet")
@Api(tags="钱包")
public class WalletInfoController {

    @Autowired
    private WalletInfoService walletInfoService;

    @PostMapping("/save")
    @ApiOperation(value = "保存钱包信息")
    public WpResult saveWallet(WalletInfoDto walletInfoDto) {
        return new WpResult().success(walletInfoService.saveWallet(walletInfoDto));
    }

    @GetMapping("/getShqc")
    @ApiOperation(value = "查询钱包SHQC资产")
    public WpResult getWalletShqcAccountInfo() {
        return new WpResult().success(walletInfoService.getWalletShqcAccountInfo());
    }

    @GetMapping("/getUsdt")
    @ApiOperation(value = "查询钱包USDT资产")
    public WpResult getWalletUsdtAccountInfo() {
        return new WpResult().success(walletInfoService.getWalletUsdtAccountInfo());
    }

}